﻿using System;
using System.Collections.Generic;

namespace ProjectMyFarmAndShe
{
    [Serializable]
    public class ChallengeSeries
    {
        public string Key { get; private set; }
        public List<ChallengeData> ChallengeDatas;
        //解锁条件
        public Func<bool> OnUnLock;
        public Func<ChallengeSeries,bool> FinishedCondition;

        public ChallengeSeries()
        {
            ChallengeDatas = new List<ChallengeData>();
        }

        public ChallengeSeries WithKey(string key)
        {
            Key = key;
            return this;
        }

        public ChallengeSeries WithOnUnLock(Func<bool> func)
        {
            OnUnLock = func;
            return this;
        }

        public ChallengeSeries WithFinishedCondition(Func<ChallengeSeries,bool> func)
        {
            FinishedCondition = func;
            return this;
        }

        public ChallengeSeries AddChallenge(ChallengeData data)
        {
            ChallengeDatas.Add(data);

            return this;
        }
    }
}